<template>
  <div>
    {{ baseURL }}
  </div>
  <button @click="getData">发送网络请求</button>
  <button @click="getTest">发送Get请求</button>
  <button @click="getdel">发送del请求</button>
  <button @click="putObj">发送put请求</button>
</template>

<script setup lang="ts">
import req, { baseURL } from "./fetch/config"

console.log(baseURL)
const getData = () => {
  req.post("/admin/login/status", { name: 'admin', password: '123' }).then(res => {
    console.log(res.data)
  })
}
const obj = { name: '夏天', password: '123', id: 1 }
const getTest = () => {
  req.get("/admin/test", obj).then(res => {
    console.log(res.data)
  })
}
const getdel = () => {
  req.deleteById("/admin/delete", 11).then(res => {
    console.log(res)
  })
}
const putObj = () => {
  req.put("/admin/put", obj).then(res => {
    console.log(res.data)
  })
}
</script>
<style lang="scss" scoped></style>@/fetch/config